import { subsOrderParam } from "@/models/request/userReq";
import { UnifiedOrderRsp } from "@/models/response/userRsp";
import { rxRequest } from "@/utils/rxHelpers";
import CONFIG from "@/config";

export default {
  //获取下单参数
  subsOrderSvc(data: subsOrderParam) {
    return rxRequest<UnifiedOrderRsp>({
      url: CONFIG.BASE_URL + "/v1/user/subs/wx/unifiedOrder",
      withJwt: true,
      data,
      method: "POST"
    })
  },

  cancelOrderSvc(orderId: string) {
    return rxRequest({
      url: CONFIG.BASE_URL + `/v1/user/subs/cancel/pay/${orderId}`,
      withJwt: true,
      method: "PUT"
    })
  }
}